class Solution {
public:
    int titleToNumber(string columnTitle) {
        int res = 0;
        for(auto e : columnTitle)
        {
            res = res * 26 - 'A' + e + 1;
        }
        return res;
    }
};